home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / Graphics / include / point_2d.h < prev    next >
Encoding:
Text File  |  1995-03-25  |  2.0 KB  |  43 lines  |  [TEXT/MMCC]

  1. //------------------------------------------------------------------------------
  2. //    File:                    point_2d.h
  3. //    Date:                    11/07/94
  4. //    Author:                Bretton Wade
  5. //
  6. //    Description:    this file contains the class definition for a 2d point
  7. //
  8. //------------------------------------------------------------------------------
  9.  
  10. #include "tuple_2d.h"
  11.  
  12. #ifndef    POINT_2D
  13. #define    POINT_2D
  14.  
  15. //------------------------------------------------------------------------------
  16. //    classes
  17. //------------------------------------------------------------------------------
  18. #ifndef    VECTOR_2D
  19. class    vector_2d;                                                                                                                                //    forward declaration
  20. #endif
  21.  
  22. //------------------------------------------------------------------------------
  23. class    point_2d : public tuple_2d                                                                                                //    point_2d class
  24. {                                                                                                                                                                //    begin
  25.     protected:                                                                                                                                        //    members internal to this class hierarchy
  26.     public:                                                                                                                                                //    members available externally
  27.                 point_2d (void) {}                                                                                                            //    default constructor
  28.                 point_2d (real x, real y);                                                                                            //    normal constructor
  29.                 point_2d (const point_2d &p);                                                                                        //    copy constructor
  30.                 point_2d (const vector_2d &v);                                                                                    //    constructor from a 2d vector_3d
  31.                 point_2d    &operator = (const point_2d &p);                                                            //    assignment operator
  32.                 point_2d    operator + (const vector_2d &v) const;                                                //    add a vector_3d to a point
  33.                 vector_2d    operator - (const point_2d &p) const;                                                    //    subtract two points
  34. };                                                                                                                                                            //    end
  35.  
  36. //------------------------------------------------------------------------------
  37. //    global variables
  38. //------------------------------------------------------------------------------
  39. extern    point_2d    ORIGIN_2D;                                                                                                        //    the origin of the coordinate system
  40.  
  41. //------------------------------------------------------------------------------
  42.  
  43. #endif    //POINT_2D